\hypertarget{udp__handler_8h}{}\section{/home/vedant/\+Programming/projects/pid-\/tuning-\/gui/esp\+\_\+codes/components/pid\+\_\+plotter/include/udp\+\_\+handler.h File Reference}
\label{udp__handler_8h}\index{/home/vedant/\+Programming/projects/pid-\/tuning-\/gui/esp\+\_\+codes/components/pid\+\_\+plotter/include/udp\+\_\+handler.\+h@{/home/vedant/\+Programming/projects/pid-\/tuning-\/gui/esp\+\_\+codes/components/pid\+\_\+plotter/include/udp\+\_\+handler.\+h}}
{\ttfamily \#include $<$string.\+h$>$}\newline
{\ttfamily \#include $<$sys/param.\+h$>$}\newline
{\ttfamily \#include \char`\"{}freertos/\+Free\+R\+T\+O\+S.\+h\char`\"{}}\newline
{\ttfamily \#include \char`\"{}freertos/task.\+h\char`\"{}}\newline
{\ttfamily \#include \char`\"{}freertos/event\+\_\+groups.\+h\char`\"{}}\newline
{\ttfamily \#include \char`\"{}esp\+\_\+system.\+h\char`\"{}}\newline
{\ttfamily \#include \char`\"{}esp\+\_\+wifi.\+h\char`\"{}}\newline
{\ttfamily \#include \char`\"{}esp\+\_\+event.\+h\char`\"{}}\newline
{\ttfamily \#include \char`\"{}esp\+\_\+log.\+h\char`\"{}}\newline
{\ttfamily \#include \char`\"{}nvs\+\_\+flash.\+h\char`\"{}}\newline
{\ttfamily \#include \char`\"{}esp\+\_\+netif.\+h\char`\"{}}\newline
{\ttfamily \#include \char`\"{}protocol\+\_\+examples\+\_\+common.\+h\char`\"{}}\newline
{\ttfamily \#include \char`\"{}logger.\+h\char`\"{}}\newline
{\ttfamily \#include \char`\"{}lwip/err.\+h\char`\"{}}\newline
{\ttfamily \#include \char`\"{}lwip/sockets.\+h\char`\"{}}\newline
{\ttfamily \#include \char`\"{}lwip/sys.\+h\char`\"{}}\newline
{\ttfamily \#include $<$lwip/netdb.\+h$>$}\newline
Include dependency graph for udp\+\_\+handler.\+h\+:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{udp__handler_8h__incl}
\end{center}
\end{figure}
This graph shows which files directly or indirectly include this file\+:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{udp__handler_8h__dep__incl}
\end{center}
\end{figure}
\subsection*{Classes}
\begin{DoxyCompactItemize}
\item 
struct \hyperlink{structnetwork__data}{network\+\_\+data}
\end{DoxyCompactItemize}
\subsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \hyperlink{udp__handler_8h_a0755be366390c472fea523dda78961d3}{H\+O\+S\+T\+\_\+\+I\+P\+\_\+\+A\+D\+DR}~C\+O\+N\+F\+I\+G\+\_\+\+U\+D\+P\+\_\+\+I\+P\+\_\+\+A\+D\+D\+R\+E\+SS
\item 
\#define \hyperlink{udp__handler_8h_a614217d263be1fb1a5f76e2ff7be19a2}{P\+O\+RT}~C\+O\+N\+F\+I\+G\+\_\+\+U\+D\+P\+\_\+\+P\+O\+RT
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void \hyperlink{udp__handler_8h_a412aa3402fc47e327861b48a04c3c08a}{network\+\_\+manager} (struct \hyperlink{structnetwork__data}{network\+\_\+data} $\ast$nm)
\begin{DoxyCompactList}\small\item\em Manages U\+DP connection to the server. \end{DoxyCompactList}\item 
int \hyperlink{udp__handler_8h_a7ddbd791c1d13c96db95eba36aae6145}{send\+\_\+data} (struct \hyperlink{structnetwork__data}{network\+\_\+data} $\ast$nm, char $\ast$payload)
\begin{DoxyCompactList}\small\item\em Sends data to the server through a U\+DP socket. \end{DoxyCompactList}\item 
char $\ast$ \hyperlink{udp__handler_8h_afe419fdd19f7194dcf9c9e6d00118224}{recieve\+\_\+data} (struct \hyperlink{structnetwork__data}{network\+\_\+data} $\ast$nm)
\begin{DoxyCompactList}\small\item\em Receives data from U\+DP server. \end{DoxyCompactList}\item 
void \hyperlink{udp__handler_8h_a3e138ed94c89bd74c249c9f4a1a4c642}{close\+\_\+network\+\_\+manager} (struct \hyperlink{structnetwork__data}{network\+\_\+data} $\ast$nm)
\begin{DoxyCompactList}\small\item\em Shutdown active connection, deallocate memory. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Macro Definition Documentation}
\mbox{\Hypertarget{udp__handler_8h_a0755be366390c472fea523dda78961d3}\label{udp__handler_8h_a0755be366390c472fea523dda78961d3}} 
\index{udp\+\_\+handler.\+h@{udp\+\_\+handler.\+h}!H\+O\+S\+T\+\_\+\+I\+P\+\_\+\+A\+D\+DR@{H\+O\+S\+T\+\_\+\+I\+P\+\_\+\+A\+D\+DR}}
\index{H\+O\+S\+T\+\_\+\+I\+P\+\_\+\+A\+D\+DR@{H\+O\+S\+T\+\_\+\+I\+P\+\_\+\+A\+D\+DR}!udp\+\_\+handler.\+h@{udp\+\_\+handler.\+h}}
\subsubsection{\texorpdfstring{H\+O\+S\+T\+\_\+\+I\+P\+\_\+\+A\+D\+DR}{HOST\_IP\_ADDR}}
{\footnotesize\ttfamily \#define H\+O\+S\+T\+\_\+\+I\+P\+\_\+\+A\+D\+DR~C\+O\+N\+F\+I\+G\+\_\+\+U\+D\+P\+\_\+\+I\+P\+\_\+\+A\+D\+D\+R\+E\+SS}

\mbox{\Hypertarget{udp__handler_8h_a614217d263be1fb1a5f76e2ff7be19a2}\label{udp__handler_8h_a614217d263be1fb1a5f76e2ff7be19a2}} 
\index{udp\+\_\+handler.\+h@{udp\+\_\+handler.\+h}!P\+O\+RT@{P\+O\+RT}}
\index{P\+O\+RT@{P\+O\+RT}!udp\+\_\+handler.\+h@{udp\+\_\+handler.\+h}}
\subsubsection{\texorpdfstring{P\+O\+RT}{PORT}}
{\footnotesize\ttfamily \#define P\+O\+RT~C\+O\+N\+F\+I\+G\+\_\+\+U\+D\+P\+\_\+\+P\+O\+RT}



\subsection{Function Documentation}
\mbox{\Hypertarget{udp__handler_8h_a3e138ed94c89bd74c249c9f4a1a4c642}\label{udp__handler_8h_a3e138ed94c89bd74c249c9f4a1a4c642}} 
\index{udp\+\_\+handler.\+h@{udp\+\_\+handler.\+h}!close\+\_\+network\+\_\+manager@{close\+\_\+network\+\_\+manager}}
\index{close\+\_\+network\+\_\+manager@{close\+\_\+network\+\_\+manager}!udp\+\_\+handler.\+h@{udp\+\_\+handler.\+h}}
\subsubsection{\texorpdfstring{close\+\_\+network\+\_\+manager()}{close\_network\_manager()}}
{\footnotesize\ttfamily void close\+\_\+network\+\_\+manager (\begin{DoxyParamCaption}\item[{struct \hyperlink{structnetwork__data}{network\+\_\+data} $\ast$}]{nm }\end{DoxyParamCaption})}



Shutdown active connection, deallocate memory. 


\begin{DoxyParams}{Parameters}
{\em nm} & \hyperlink{structtcp__network__data}{tcp\+\_\+network\+\_\+data} struct which contains connection info \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
void 
\end{DoxyReturn}
\mbox{\Hypertarget{udp__handler_8h_a412aa3402fc47e327861b48a04c3c08a}\label{udp__handler_8h_a412aa3402fc47e327861b48a04c3c08a}} 
\index{udp\+\_\+handler.\+h@{udp\+\_\+handler.\+h}!network\+\_\+manager@{network\+\_\+manager}}
\index{network\+\_\+manager@{network\+\_\+manager}!udp\+\_\+handler.\+h@{udp\+\_\+handler.\+h}}
\subsubsection{\texorpdfstring{network\+\_\+manager()}{network\_manager()}}
{\footnotesize\ttfamily void network\+\_\+manager (\begin{DoxyParamCaption}\item[{struct \hyperlink{structnetwork__data}{network\+\_\+data} $\ast$}]{nm }\end{DoxyParamCaption})}



Manages U\+DP connection to the server. 


\begin{DoxyParams}{Parameters}
{\em nm} & \hyperlink{structnetwork__data}{network\+\_\+data} struct which contains necessary data for a U\+DP connection \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
void 
\end{DoxyReturn}
\mbox{\Hypertarget{udp__handler_8h_afe419fdd19f7194dcf9c9e6d00118224}\label{udp__handler_8h_afe419fdd19f7194dcf9c9e6d00118224}} 
\index{udp\+\_\+handler.\+h@{udp\+\_\+handler.\+h}!recieve\+\_\+data@{recieve\+\_\+data}}
\index{recieve\+\_\+data@{recieve\+\_\+data}!udp\+\_\+handler.\+h@{udp\+\_\+handler.\+h}}
\subsubsection{\texorpdfstring{recieve\+\_\+data()}{recieve\_data()}}
{\footnotesize\ttfamily char$\ast$ recieve\+\_\+data (\begin{DoxyParamCaption}\item[{struct \hyperlink{structnetwork__data}{network\+\_\+data} $\ast$}]{nm }\end{DoxyParamCaption})}



Receives data from U\+DP server. 


\begin{DoxyParams}{Parameters}
{\em nm} & \hyperlink{structnetwork__data}{network\+\_\+data} struct which contains connection info \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
char array which contains data received 
\end{DoxyReturn}
\mbox{\Hypertarget{udp__handler_8h_a7ddbd791c1d13c96db95eba36aae6145}\label{udp__handler_8h_a7ddbd791c1d13c96db95eba36aae6145}} 
\index{udp\+\_\+handler.\+h@{udp\+\_\+handler.\+h}!send\+\_\+data@{send\+\_\+data}}
\index{send\+\_\+data@{send\+\_\+data}!udp\+\_\+handler.\+h@{udp\+\_\+handler.\+h}}
\subsubsection{\texorpdfstring{send\+\_\+data()}{send\_data()}}
{\footnotesize\ttfamily int send\+\_\+data (\begin{DoxyParamCaption}\item[{struct \hyperlink{structnetwork__data}{network\+\_\+data} $\ast$}]{nm,  }\item[{char $\ast$}]{payload }\end{DoxyParamCaption})}



Sends data to the server through a U\+DP socket. 


\begin{DoxyParams}{Parameters}
{\em nm} & A pointer to \hyperlink{structnetwork__data}{network\+\_\+data} struct \\
\hline
{\em payload} & char array which contains data to be sent \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
int -\/ returns -\/1 if sending failed, number of bytes sent if successfully sent the data 
\end{DoxyReturn}
